package com.fastmobile.impl;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import org.json.JSONException;
import org.json.JSONObject;

import com.fastmobile.dao.AdvancePaymentRequestDao;
import com.fastmobile.entity.ContactsList;
import com.fastmobile.entity.Departments;
import com.fastmobile.entity.Transactions;
import com.fastmobile.entity.AdvancePaymentRequest;
import com.fastmobile.entity.AdvancePaymentRequestDetail;

public class AdvancePaymentRequestImpl implements AdvancePaymentRequestDao{
	protected EntityManager em;
	
	public EntityManager getEntityManager() {
		return em;
	}
	
	public void setEntityManager(EntityManager em) {
		this.em = em;
	}
	
//	@SuppressWarnings("unchecked")
//	@Override
//	public List<JSONObject> getAdvancePaymentRequestDetailByAdvId(String advId) {
//		Query query = em.createNativeQuery("SELECT adv.*, advd.* FROM ADVANCE c", ContactsList.class);
//		
//		List<JSONObject> listObj = new ArrayList<JSONObject>();
//		for (ContactsList contact:list) {
//			JSONObject json = new JSONObject();
//			json.put("contactId", contact.getContactId());
//			json.put("userName", contact.getUserName());
//			listObj.add(json);
//		}
//		return listObj;
//	}

}
